//
//  RGXLoginController.m
//  JiCaiBao
//
//  Created by rgx on 16/11/4.
//  Copyright © 2016年 rgx. All rights reserved.
//

#import "RGXLoginController.h"

@interface RGXLoginController ()

@end

@implementation RGXLoginController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    self.navigationController.navigationBar.barTintColor = ColorWithRGB(231, 66, 66);
    
    [self setShowTitle:@"登录"];
    [self initLeftNavigationBarItem];

}

-(void)initLeftNavigationBarItem
{
    
    
    UIButton *pLeftButton = [UIButton buttonWithType:UIButtonTypeCustom];
    pLeftButton.frame = CGRectMake(-10, 0, 44, 44);
    [pLeftButton setTitle:@"取消" forState:UIControlStateNormal];
    [pLeftButton addTarget:self action:@selector(backButtonEvents:) forControlEvents:UIControlEventTouchUpInside];
    UIBarButtonItem *pLeftButtonItem = [[UIBarButtonItem alloc] initWithCustomView:pLeftButton];
    UIBarButtonItem *negativeSpacer = [[ UIBarButtonItem alloc ] initWithBarButtonSystemItem : UIBarButtonSystemItemFixedSpace target : nil action : nil ];
    negativeSpacer. width = - 10 ;//这个数值可以根据情况自由变化
    self.navigationItem.leftBarButtonItems = @[ negativeSpacer, pLeftButtonItem ] ;
    //    self.navigationItem.leftBarButtonItem = pLeftButtonItem;
    
}

- (void)backButtonEvents:(id)sender
{
    [self dismissViewControllerAnimated:YES completion:^{
        
        
    }];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
